import XCTest
@testable import LibNetwork

final class LibNetworkTests: XCTestCase {
    func testExample() throws {
        // This is an example of a functional test case.
        // Use XCTAssert and related functions to verify your tests produce the correct
        
        var url = URL(string: "http://www.test.com/a/")
        
        url?.appendPathComponent("b")
        XCTAssertEqual("http://www.test.com/a/b", url?.absoluteString)
        
        url?.appendPathComponent("/b")
        XCTAssertEqual("http://www.test.com/b", url?.absoluteString)
        
        url?.app("http://www.api.com/b")
        XCTAssertEqual("http://www.api.com/b", url?.absoluteString)
        
        // results.
        XCTAssertEqual(APIResultError.appResultMapping.localizedDescription,
                       "Failed to map data to APIResult dictionary.")
    }
}
